class Solution(object):
    def judgeSquareSum(self, c):
        """
        :type c: int
        :rtype: bool
        """
        for i in range(0, int((c / 2) ** 0.5) + 1):
            j = round((c - i ** 2) ** 0.5)
            if j ** 2 + i ** 2 == c:
                return True
        return False

data = Solution()
c = 5
print(data.judgeSquareSum(c))